import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  { 
    path: '/', redirect:'/welcome'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    component: () => import( '../views/About.vue')
  },
  {
    path: '/top250',
    name: 'Top250',
    component: () => import( '../views/Top250.vue')
  },
  {
    path: '/wyy',
    name: 'Wyy',
    component: () => import( '../views/Wyy.vue')
  }
  ,
  { 
      path: '/moviedetail', name:'Moviedetail',
      component: ()=> import('../views/Moviedetail.vue') 
  }
  ,
  { 
      path: '/musicdetail', name:'Musicdetail',
      component: ()=> import('../views/Musicdetail.vue') 
  },
  { 
      path: '/welcome', name:'Welcome',
      component: ()=> import('../views/Welcome.vue') 
  },
  
  { 
    path: '/*', name:'Error',
    component: ()=> import('../views/Error.vue') 
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
